<template>
  <view class="success-page">
    <view class="content">

      <view class="title">提交成功</view>
      
      <!-- 驳回操作提示 -->
      <view class="desc" v-if="act == 'refuse'">您已成功驳回该信息</view>
      
      <!-- 出售申请提示 - type=1 -->
      <view class="desc" v-else-if="type == 1 || type == '1'">您的出售申请已成功提交，我们将尽快为您处理。</view>
      
      <!-- 默认提示（车辆评估等其他场景） -->
      <view class="desc" v-else>您的车辆信息已成功提交，我们将尽快处理。</view>
      
      <button class="btn" @tap="goHome">返回首页</button>
    </view>

  </view>
</template>

<script>
export default {
  data() {
    return {
      countdown: 5,
      timer: null,
      act: '', // 操作类型：refuse=驳回
      type: '' // 业务类型标识：1=出售申请, 空=默认（车辆评估等）
    }
  },
  onLoad(options) {
    this.act = options.act || '';
    this.type = options.type || '';
  },
  methods: {
    startCountdown() {
      this.timer = setInterval(() => {
        if (this.countdown <= 1) {
          clearInterval(this.timer)
          this.goHome()
        } else {
          this.countdown--
        }
      }, 1000)
    },
    goHome() {
		uni.switchTab({
			url:'/pages/index/yewu'
		});
    }
  },
  onUnload() {
    clearInterval(this.timer)
  }
}
</script>

<style>
.success-page {
  background: #f8fafc;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 40rpx;
}

.content {
  background: #fff;
  padding: 60rpx 40rpx;
  border-radius: 20rpx;
  box-shadow: 0 8rpx 20rpx rgba(0,0,0,0.06);
  width: 80%;
  max-width: 640rpx;
}

.icon {
  width: 160rpx;
  margin-bottom: 30rpx;
}

.title {
  font-size: 40rpx;
  color: #111827;
  font-weight: 600;
  margin-bottom: 10rpx;
}

.desc {
  font-size: 28rpx;
  color: #6b7280;
  margin-bottom: 40rpx;
  line-height: 1.5;
}

.btn {
  background: #007aff;
  color: #fff;
  font-size: 32rpx;
  border-radius: 50rpx;
  height: 88rpx;
  line-height: 88rpx;
  width: 100%;
  font-weight: 600;
}

.btn:active {
  opacity: 0.9;
}

.tips {
  margin-top: 40rpx;
  color: #9ca3af;
  font-size: 26rpx;
}
</style>
